import React from 'react'
import {Button, EmailSignupForm, FormControl, FormList} from "react-appwrite-auth-ui"
const MyForm = () => {
const [email, setEmail] = React.useState("")
const [password, setPassword] = React.useState("")
const onAuthError = (error) => {
console.log("error in signup" , error)
}
const onAuthSuccess = (response) => {
console.log('success in email signup', response)
}
return (<EmailSignupForm
email={email}
password={password}
onAuthError={onAuthError}
onAuthSuccess={onAuthSuccess}
>
<FormList>
<FormControl
label='Email'
type='email'
value={email}
onChange={(e) => setEmail(e.target.value)}/>
<FormControl
label='Password'
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}/>
</FormList>
<Button type='submit' className='u-margin-block-start-16' > Sign up</Button>
</EmailSignupForm>
)
}
export default MyForm